package com.haike.pushjobs.sdk;

import cn.hutool.core.map.MapUtil;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.haike.pushjobs.mapper.SqlStringMapper;
import lombok.extern.slf4j.Slf4j;
import lombok.var;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.HashMap;
import java.util.List;
import java.util.Map;


@DS("xiamen")
@Component
@Slf4j
public class XiaMenDBClient {

    @Autowired
    SqlStringMapper sqlStringMapper;


    public List<Map<String, Object>> getPage(String sql, int pageIndex, int pageSize) {
        Page<Object> page = PageHelper.startPage(pageIndex, pageSize);
        var list = sqlStringMapper.selectData(sql, null);
        return list;

    }
}
